// d:\project\honey-Alliance-project\shenye-dy-applet\pages\Agreement\Agreement.js
import {
  getCustomerAgreementDetail
} from '../../api/login'
const handleAuthorize = require('../../utils/handleAuthorize')
Page({
  data: {
    type: '1', //1:用户服务协议，2：用户隐私协议
    nodes:'',//富文本内容
  },
  onLoad: function (options) {
    this.data.type = options.type
    setTimeout(()=>{
      tt.setNavigationBarTitle({
        title: options.title
      })
    },200)
    this.getInfo()
  },
  // 获取协议信息
  async getInfo() {
    var res = await getCustomerAgreementDetail(this.data.type)
    let data = res.result.agreement
    this.setData({
      nodes:handleAuthorize.repairRichText(data)
    })
  },
})